﻿@model Tuple<List<Nutrapp.Models.RecipeModel>>

@{
    ViewBag.Title = "Home Page";
}
<div class="row">

    <div class="rec" style="padding-left: 5px;">

        <div>

            @{
                int a;
                if (Request.QueryString["id"] == null)
                {
                    a = 5;
                }

                else
                {
                    a = int.Parse(Request.QueryString["id"]);

                }


            }

            <div class="rec_title" style="margin-bottom:5px;">
                <p class="name_rec" style="font-size:30px"> @Model.Item1.Where(i => i.ID == a).FirstOrDefault().Name</p>
            </div>

            <div id="picture_index">
                <img src="~/Upload/RecipeImage/@Model.Item1.Where(i => i.ID == a).FirstOrDefault().Picture" alt="" style="height:100%; width:100%" />
            </div>

            <div class="list_items">


                <div class="ingr_block">
                    <p class="list_title" style="font-size:25px"><img src="~/Images/ingredient.png" alt=""> Ingredients</p>

                    <ul style="list-style:none">



                        @*@foreach (var ingr in Model.Item1.Where(x => x.ID == a).FirstOrDefault().IngredientLines)
                            {
                                <li>
                                    <img src="~/Images/spoon.png" alt=""> @ingr.Ingredient.Name.ToString()
                                    @ingr.Quantity.ToString()
                                    @ingr.Unit1.Unit1.ToString()
                                </li>
                            }*@
                    </ul>


                </div>

                <div class="nutr_block">
                    <p class="list_title" style="font-size:25px"><img src="~/Images/nutrition.png" alt="" style="height: 64px; width: 64px"> Nutrition</p>
                    <ul style="list-style:none">

                        <li style="list-style:none;font-size:22px"><img src="~/Images/jar.png" alt=""> Carbohydrate: @Model.Item1.Where(i => i.ID == a).FirstOrDefault().Carbohydrate.ToString()</li>
                        <li><img src="~/Images/jar.png" alt=""> Protein: @Model.Item1.Where(i => i.ID == a).FirstOrDefault().Protein.ToString()</li>
                        <li><img src="~/Images/jar.png" alt=""> Calories: @Model.Item1.Where(i => i.ID == a).FirstOrDefault().Calories.ToString()</li>
                        <li><img src="~/Images/jar.png" alt=""> Fat: @Model.Item1.Where(i => i.ID == a).FirstOrDefault().Fat.ToString()</li>
                        <li><a style="font-size:15px" href="~/Recipe/View?id=@Model.Item1.Where(i => i.ID == a).FirstOrDefault().ID"> check the full recipe</a></li>

                    </ul>
                </div>


                <div>
                </div>
            </div>

        </div>
    </div>

    <div class="image-gallery" style="padding-left: 5px;">
        <h2> Newest Recipes</h2>
        <div class="thumbnails">
            <ul>
                @foreach (var item in Model.Item1)
                {
                    <li>

                        <a href="~/Home/Index?id=@item.ID"><img id="img" src="~/Upload/RecipeImage/@item.Picture" alt="Image Not Loaded" /></a>
                        <p class="rec_name_small">@item.Name</p>
                    </li>
                }

            </ul>
        </div>
    </div>
</div>